package com.cloud.mall.sms.service;

import com.cloud.mall.api.CommonPage;
import com.cloud.mall.base.BaseResponse;
import com.cloud.mall.sms.dto.SmsFlashPromotionSessionDetail;
import com.cloud.mall.sms.input.SmsFlashPromotionSessionInpDTO;
import com.cloud.mall.sms.input.SmsHomeAdvertiseInpDTO;
import com.cloud.mall.sms.out.SmsFlashPromotionSessionOut;
import com.cloud.mall.sms.out.SmsHomeAdvertiseOut;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "首页轮播广告管理")
@RequestMapping("/home/advertise")
public interface SmsHomeAdvertiseService {


    @ApiOperation("添加广告")
    @PostMapping("/create")
    BaseResponse create(@RequestBody SmsHomeAdvertiseInpDTO smsHomeAdvertiseInpDTO);

    @ApiOperation("修改广告")
    @PostMapping("/update/{id}")
    BaseResponse update(@PathVariable Long id,
                        @RequestBody SmsHomeAdvertiseInpDTO smsHomeAdvertiseInpDTO);

    @ApiOperation("删除广告")
    @PostMapping("/delete/{id}")
    BaseResponse delete(@PathVariable Long id);

    @ApiOperation("修改上下线状态")
    @PostMapping("/update/status/{id}")
    BaseResponse update(@PathVariable Long id, @RequestParam Integer status);

    @ApiOperation("获取广告详情")
    @GetMapping("/{id}")
    BaseResponse<SmsHomeAdvertiseOut> getItem(@PathVariable Long id);


    @ApiOperation("分页查询广告")
    @GetMapping("/list")
    BaseResponse<CommonPage<SmsHomeAdvertiseOut>> list(@RequestParam(value = "name", required = false) String name,
                                                             @RequestParam(value = "type", required = false) Integer type,
                                                             @RequestParam(value = "endTime", required = false) String endTime,
                                                             @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum);

    @ApiOperation("获取上线广告集合")
    @GetMapping("/getHomeAdvertiseList")
    BaseResponse<List<SmsHomeAdvertiseOut>> getHomeAdvertiseList();

}
